﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MenuSet.aspx.cs" Inherits="CNVP.JShop.Web.Admin.CommonWindows.MenuSet" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../CSS/Edit.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery.js" type="text/javascript"></script>
    <script src="../../Scripts/Common.js" type="text/javascript"></script>
    <script type ="text/javascript">
        $(function () {
            $("#ButtonAddSubMenu").click(function () {
                var $txtID = $("#txtID");
                var $txtDepth = $("#txtDepth");
                if ($txtID.val() == "" && $txtDepth.val()=="") {
                    alert("请选择左边节点！");
                    return false;
                }
                return true;
            });
            $("#btUp").click(function () {
                var $txtDepth = $("#txtDepth");
                var $txtMenuName = $("#txtMenuName");
                var $txtMenuUrl = $("#txtMenuUrl");
                var $txtWeight = $("#txtWeight");
                if ($txtDepth.val() == "") {
                    alert("请点击左边添加节点按钮！");
                    return false;
                }
                if ($txtMenuName.val() == "") {
                    alert("请输入名称！");
                    $txtMenuName.focus();
                    return false;
                }
                if ($txtMenuUrl.val() == "") {
                    alert("请输入URL地址！");
                    $txtMenuUrl.focus();
                    return false;
                }
                if ($txtWeight.val() == "") {
                    alert("请输入排序！");
                    $txtWeight.focus();
                    return false;
                }
                else if (!IsInteger($txtWeight.val())) {
                    alert("排序格式不正确！");
                    $txtWeight.focus();
                    return false;
                }
                return true;
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
      <table border="0" cellpadding="0" cellspacing="0" class="division">
        <tr>
                <td style="width: 150px;" valign="top">
                    <div class="EditBtnMenu">  
                    <asp:Button ID="ButtonAddSubMenu" runat="server" Text="添加子节点" 
                        OnClick="ButtonAddSubMenu_Click"  />
                    <br />
                        <br />
                    <asp:Button ID="ButtonDelete" runat="server" Text="删除该节点" 
                        onclick="ButtonDelete_Click"  />
                    <br />
                        <br />
                        <asp:Label ID="lbSelectNodesText" runat="server" CssClass="Display"></asp:Label>
                    <br />
                    </div>
                </td>
                <td valign="top">
                    <table border="0" cellpadding="0" cellspacing="0" class="division">
                        <tr class="Display">
                            <th>
                                菜单项ID:</th>
                            <td>
                                <asp:TextBox ID="txtID" runat="server" ReadOnly="True"  />
                                </td>
                        </tr>
                        <tr class="Display">
                            <th>
                                上级菜单项ID:</th>
                            <td>
                                    <asp:TextBox ID="txtDepth" runat="server" ReadOnly="True" Text="0"  />
                                </td>
                        </tr>
                        <tr>
                            <th>
                                    名&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;称:</th>
                            <td style=" width:400px;">
                                <asp:TextBox ID="txtMenuName" runat="server" />
                                </td>
                        </tr>
                        <tr>
                            <th>
                                URL:</th>
                            <td>
                                    <asp:TextBox ID="txtMenuUrl" runat="server"  />
                                </td>
                        </tr>
                        <tr>
                            <th>
                                排&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;序:</th>
                            <td>
                                <asp:TextBox ID="txtWeight" runat="server" Text="0"  />
                                </td>
                        </tr>
                        <tr>
                            <th>
                                </th>
                            <td>
                            <div class="EditBtnMenu">  
                                <asp:Button ID="btUp" runat="server" Text="提交" onclick="btUp_Click" />
                                </div> 
                                </td>
                        </tr>
                    </table>
                </td>
        </tr>
      </table>
    </form>
</body>
</html>
